import { Component, OnInit } from '@angular/core';
import { Headers, Http } from '@angular/http';
import 'rxjs/add/operator/toPromise';

@Component({
  selector: 'app-operator',
  templateUrl: './operator.component.html',
  styleUrls: ['./operator.component.css']
})
export class OperatorComponent implements OnInit {

  private headers = new Headers({'Content-Type': 'application/json'});
  
  constructor(
    private http: Http
  ) { }

  ngOnInit() {

  }

  getAjaxData() {

    this.http.post('/api/sys/operator/list', JSON.stringify({}), {headers: this.headers}).toPromise().then((response) => { 
      console.log(response.json());
    });
  }
}
